package com.beyond.market.record.controller;

import com.beyond.market.record.domain.Record;
import com.beyond.market.record.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.sql.SQLException;
import java.util.List;

@Controller
public class RecordController {
    @Autowired
    private RecordService recordService;


    @RequestMapping("/listByUserId")
    public String listByUserId(Integer id, ModelMap mm){
        try {
            List<Record> list = recordService.listByUserId(id);
            mm.put("list",list);
            return "/record/listByUserId";
        }catch (SQLException e){
        }
       return null;
    }



}
